package cn.gson.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the CONSTACT_ORDER database table.
 * 
 */
@Entity
@Table(name="CONSTACT_ORDER")
@NamedQuery(name="ConstactOrder.findAll", query="SELECT c FROM ConstactOrder c")
public class ConstactOrder implements Serializable {
	public ConstactOrder(BigDecimal coAllMoney, String coGetMan, String coManAddress, String coManPhone,
			String coPayWay, String coState, String coTheme, String coType) {
		super();
		this.coAllMoney = coAllMoney;
		this.coGetMan = coGetMan;
		this.coManAddress = coManAddress;
		this.coManPhone = coManPhone;
		this.coPayWay = coPayWay;
		this.coState = coState;
		this.coTheme = coTheme;
		this.coType = coType;
	}



	private static final long serialVersionUID = 1L;

	
	public ConstactOrder(long coId, BigDecimal coAllMoney, BigDecimal coChanceId, String coChanceName,
			BigDecimal coCusId, String coCusName, Date coEndTime, String coGetMan, String coJieWay, String coManAddress,
			String coManPhone, String coOwner, String coPayWay, String coRemarks, Date coSendTime, Date coStartTime,
			String coState, String coText, String coTheme, String coType, String code) {
		super();
		this.coId = coId;
		this.coAllMoney = coAllMoney;
		this.coChanceId = coChanceId;
		this.coChanceName = coChanceName;
		this.coCusId = coCusId;
		this.coCusName = coCusName;
		this.coEndTime = coEndTime;
		this.coGetMan = coGetMan;
		this.coJieWay = coJieWay;
		this.coManAddress = coManAddress;
		this.coManPhone = coManPhone;
		this.coOwner = coOwner;
		this.coPayWay = coPayWay;
		this.coRemarks = coRemarks;
		this.coSendTime = coSendTime;
		this.coStartTime = coStartTime;
		this.coState = coState;
		this.coText = coText;
		this.coTheme = coTheme;
		this.coType = coType;
		this.code = code;
	}
	
	
	
	@Id
	@SequenceGenerator(initialValue=1,allocationSize=1,name="CONSTACT_ORDER_COID_GENERATOR", sequenceName="SEQ_13")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CONSTACT_ORDER_COID_GENERATOR")
	@Column(name="CO_ID")
	private long coId;

	@Column(name="CO_ALL_MONEY")
	private BigDecimal coAllMoney;

	@Column(name="CO_CHANCE_ID")
	private BigDecimal coChanceId;

	@Column(name="CO_CHANCE_NAME")
	private String coChanceName;

	@Column(name="CO_CUS_ID")
	private BigDecimal coCusId;

	@Column(name="CO_CUS_NAME")
	private String coCusName;

	@Temporal(TemporalType.DATE)
	@Column(name="CO_END_TIME")
	private Date coEndTime;

	@Column(name="CO_GET_MAN")
	private String coGetMan;

	@Column(name="CO_JIE_WAY")
	private String coJieWay;

	@Column(name="CO_MAN_ADDRESS")
	private String coManAddress;

	@Column(name="CO_MAN_PHONE")
	private String coManPhone;

	@Column(name="CO_OWNER")
	private String coOwner;

	@Column(name="CO_PAY_WAY")
	private String coPayWay;

	@Column(name="CO_REMARKS")
	private String coRemarks;

	@Temporal(TemporalType.DATE)
	@Column(name="CO_SEND_TIME")
	private Date coSendTime;

	@Temporal(TemporalType.DATE)
	@Column(name="CO_START_TIME")
	private Date coStartTime;

	@Column(name="CO_STATE")
	private String coState;

	@Column(name="CO_TEXT")
	private String coText;

	@Column(name="CO_THEME")
	private String coTheme;

	@Column(name="CO_TYPE")
	private String coType;

	private String code;

	//bi-directional many-to-one association to Backplan
	@OneToMany(mappedBy="constactOrder")
	private List<Backplan> backplans;

	//bi-directional many-to-one association to Backrecord
	@OneToMany(mappedBy="constactOrder")
	private List<Backrecord> backrecords;

	//bi-directional many-to-one association to Customerinfo
	@ManyToOne
	@JoinColumn(name="CUST_ID")
	private Customerinfo customerinfo;

	//bi-directional many-to-one association to Openticketrecord
	@ManyToOne
	@JoinColumn(name="OTR_ID")
	private Openticketrecord openticketrecord;

	//bi-directional many-to-one association to Ordercancel
	@ManyToOne
	@JoinColumn(name="OC_ID")
	private Ordercancel ordercancel;

	//bi-directional many-to-one association to Sendgoodsform
	@ManyToOne
	@JoinColumn(name="SGF_ID")
	private Sendgoodsform sendgoodsform;

	//bi-directional many-to-one association to Openticketrecord
	@OneToMany(mappedBy="constactOrder")
	private List<Openticketrecord> openticketrecords;

	//bi-directional many-to-one association to Ordercancel
	@OneToMany(mappedBy="constactOrder")
	private List<Ordercancel> ordercancels;

	//bi-directional many-to-one association to Orderdetails1
	@OneToMany(mappedBy="constactOrder")
	private List<Orderdetails1> orderdetails1s;

	//bi-directional many-to-one association to Sendgoodsdetail
	@OneToMany(mappedBy="constactOrder")
	private List<Sendgoodsdetail> sendgoodsdetails;

	//bi-directional many-to-one association to Sendgoodsform
	@OneToMany(mappedBy="constactOrder")
	private List<Sendgoodsform> sendgoodsforms;

	public ConstactOrder() {
	}

	public long getCoId() {
		return this.coId;
	}

	public void setCoId(long coId) {
		this.coId = coId;
	}

	public BigDecimal getCoAllMoney() {
		return this.coAllMoney;
	}

	public void setCoAllMoney(BigDecimal coAllMoney) {
		this.coAllMoney = coAllMoney;
	}

	public BigDecimal getCoChanceId() {
		return this.coChanceId;
	}

	public void setCoChanceId(BigDecimal coChanceId) {
		this.coChanceId = coChanceId;
	}

	public String getCoChanceName() {
		return this.coChanceName;
	}

	public void setCoChanceName(String coChanceName) {
		this.coChanceName = coChanceName;
	}

	public BigDecimal getCoCusId() {
		return this.coCusId;
	}

	public void setCoCusId(BigDecimal coCusId) {
		this.coCusId = coCusId;
	}

	public String getCoCusName() {
		return this.coCusName;
	}

	public void setCoCusName(String coCusName) {
		this.coCusName = coCusName;
	}

	public Date getCoEndTime() {
		return this.coEndTime;
	}

	public void setCoEndTime(Date coEndTime) {
		this.coEndTime = coEndTime;
	}

	public String getCoGetMan() {
		return this.coGetMan;
	}

	public void setCoGetMan(String coGetMan) {
		this.coGetMan = coGetMan;
	}

	public String getCoJieWay() {
		return this.coJieWay;
	}

	public void setCoJieWay(String coJieWay) {
		this.coJieWay = coJieWay;
	}

	public String getCoManAddress() {
		return this.coManAddress;
	}

	public void setCoManAddress(String coManAddress) {
		this.coManAddress = coManAddress;
	}

	public String getCoManPhone() {
		return this.coManPhone;
	}

	public void setCoManPhone(String coManPhone) {
		this.coManPhone = coManPhone;
	}

	public String getCoOwner() {
		return this.coOwner;
	}

	public void setCoOwner(String coOwner) {
		this.coOwner = coOwner;
	}

	public String getCoPayWay() {
		return this.coPayWay;
	}

	public void setCoPayWay(String coPayWay) {
		this.coPayWay = coPayWay;
	}

	public String getCoRemarks() {
		return this.coRemarks;
	}

	public void setCoRemarks(String coRemarks) {
		this.coRemarks = coRemarks;
	}

	public Date getCoSendTime() {
		return this.coSendTime;
	}

	public void setCoSendTime(Date coSendTime) {
		this.coSendTime = coSendTime;
	}

	public Date getCoStartTime() {
		return this.coStartTime;
	}

	public void setCoStartTime(Date coStartTime) {
		this.coStartTime = coStartTime;
	}

	public String getCoState() {
		return this.coState;
	}

	public void setCoState(String coState) {
		this.coState = coState;
	}

	public String getCoText() {
		return this.coText;
	}

	public void setCoText(String coText) {
		this.coText = coText;
	}

	public String getCoTheme() {
		return this.coTheme;
	}

	public void setCoTheme(String coTheme) {
		this.coTheme = coTheme;
	}

	public String getCoType() {
		return this.coType;
	}

	public void setCoType(String coType) {
		this.coType = coType;
	}

	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public List<Backplan> getBackplans() {
		return this.backplans;
	}

	public void setBackplans(List<Backplan> backplans) {
		this.backplans = backplans;
	}

	public Backplan addBackplan(Backplan backplan) {
		getBackplans().add(backplan);
		backplan.setConstactOrder(this);

		return backplan;
	}

	public Backplan removeBackplan(Backplan backplan) {
		getBackplans().remove(backplan);
		backplan.setConstactOrder(null);

		return backplan;
	}

	public List<Backrecord> getBackrecords() {
		return this.backrecords;
	}

	public void setBackrecords(List<Backrecord> backrecords) {
		this.backrecords = backrecords;
	}

	public Backrecord addBackrecord(Backrecord backrecord) {
		getBackrecords().add(backrecord);
		backrecord.setConstactOrder(this);

		return backrecord;
	}

	public Backrecord removeBackrecord(Backrecord backrecord) {
		getBackrecords().remove(backrecord);
		backrecord.setConstactOrder(null);

		return backrecord;
	}

	public Customerinfo getCustomerinfo() {
		return this.customerinfo;
	}

	public void setCustomerinfo(Customerinfo customerinfo) {
		this.customerinfo = customerinfo;
	}

	public Openticketrecord getOpenticketrecord() {
		return this.openticketrecord;
	}

	public void setOpenticketrecord(Openticketrecord openticketrecord) {
		this.openticketrecord = openticketrecord;
	}

	public Ordercancel getOrdercancel() {
		return this.ordercancel;
	}

	public void setOrdercancel(Ordercancel ordercancel) {
		this.ordercancel = ordercancel;
	}

	public Sendgoodsform getSendgoodsform() {
		return this.sendgoodsform;
	}

	public void setSendgoodsform(Sendgoodsform sendgoodsform) {
		this.sendgoodsform = sendgoodsform;
	}

	public List<Openticketrecord> getOpenticketrecords() {
		return this.openticketrecords;
	}

	public void setOpenticketrecords(List<Openticketrecord> openticketrecords) {
		this.openticketrecords = openticketrecords;
	}

	public Openticketrecord addOpenticketrecord(Openticketrecord openticketrecord) {
		getOpenticketrecords().add(openticketrecord);
		openticketrecord.setConstactOrder(this);

		return openticketrecord;
	}

	public Openticketrecord removeOpenticketrecord(Openticketrecord openticketrecord) {
		getOpenticketrecords().remove(openticketrecord);
		openticketrecord.setConstactOrder(null);

		return openticketrecord;
	}

	public List<Ordercancel> getOrdercancels() {
		return this.ordercancels;
	}

	public void setOrdercancels(List<Ordercancel> ordercancels) {
		this.ordercancels = ordercancels;
	}

	public Ordercancel addOrdercancel(Ordercancel ordercancel) {
		getOrdercancels().add(ordercancel);
		ordercancel.setConstactOrder(this);

		return ordercancel;
	}

	public Ordercancel removeOrdercancel(Ordercancel ordercancel) {
		getOrdercancels().remove(ordercancel);
		ordercancel.setConstactOrder(null);

		return ordercancel;
	}

	public List<Orderdetails1> getOrderdetails1s() {
		return this.orderdetails1s;
	}

	public void setOrderdetails1s(List<Orderdetails1> orderdetails1s) {
		this.orderdetails1s = orderdetails1s;
	}

	public Orderdetails1 addOrderdetails1(Orderdetails1 orderdetails1) {
		getOrderdetails1s().add(orderdetails1);
		orderdetails1.setConstactOrder(this);

		return orderdetails1;
	}

	public Orderdetails1 removeOrderdetails1(Orderdetails1 orderdetails1) {
		getOrderdetails1s().remove(orderdetails1);
		orderdetails1.setConstactOrder(null);

		return orderdetails1;
	}

	public List<Sendgoodsdetail> getSendgoodsdetails() {
		return this.sendgoodsdetails;
	}

	public void setSendgoodsdetails(List<Sendgoodsdetail> sendgoodsdetails) {
		this.sendgoodsdetails = sendgoodsdetails;
	}

	public Sendgoodsdetail addSendgoodsdetail(Sendgoodsdetail sendgoodsdetail) {
		getSendgoodsdetails().add(sendgoodsdetail);
		sendgoodsdetail.setConstactOrder(this);

		return sendgoodsdetail;
	}

	public Sendgoodsdetail removeSendgoodsdetail(Sendgoodsdetail sendgoodsdetail) {
		getSendgoodsdetails().remove(sendgoodsdetail);
		sendgoodsdetail.setConstactOrder(null);

		return sendgoodsdetail;
	}

	public List<Sendgoodsform> getSendgoodsforms() {
		return this.sendgoodsforms;
	}

	public void setSendgoodsforms(List<Sendgoodsform> sendgoodsforms) {
		this.sendgoodsforms = sendgoodsforms;
	}

	public Sendgoodsform addSendgoodsform(Sendgoodsform sendgoodsform) {
		getSendgoodsforms().add(sendgoodsform);
		sendgoodsform.setConstactOrder(this);

		return sendgoodsform;
	}

	public Sendgoodsform removeSendgoodsform(Sendgoodsform sendgoodsform) {
		getSendgoodsforms().remove(sendgoodsform);
		sendgoodsform.setConstactOrder(null);

		return sendgoodsform;
	}

}